Method and apparatus for adding segment marks in a web page

ABSTRACT

A method and apparatus for adding segment marks in a web page are proposed. The method includes: acquiring an information attribute of an information piece displayed by a web browser, and grouping information pieces having a same information attribute into a same information segment; acquiring ratios of the number of information pieces within every information segment to the total number of information pieces displayed by the web browser; setting segment marks at particular locations of a scroll bar of the web browser in accordance with the ratios; and displaying the segment marks. The method can inform a user of information amounts of other pages and the reading progress of the user when the user is reading a current page.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a U.S. continuation application of InternationalApplication PCT/CN2013/091042, with an international filing date of Dec.31, 2013, which claims the priority benefit of Chinese PatentApplication No. 201310140339.7 filed on Apr. 22, 2013, the contents ofwhich are both incorporated herein by reference in their entireties forall intended purposes.

FIELD

The disclosure relates to the field of web browsing, and in particular,to a method and apparatus for adding segment marks in a web page.

BACKGROUND

When a user browses a web page, a website content provider usuallyprovides all contents for the user's viewing in segments by means of,for example, paging display or segment loading, with a purpose ofavoiding problems such as excessive information amount, too slow loadingspeed, and so on caused by loading all contents at once. However,current paging display or segment loading is loading of equivalentamount of information (usually, the numbers of information pieces inevery page or segment are equal). That is, information loaded withinevery page or segment has the same amount, and the paging display orsegment loading is not performed in accordance with informationattributes (for example, time attribute). In some website servicesarranging contents in a reverse chronological order (for example, SocialNetwork Services (SNS) such as Twitter and so on), the time attribute ofinformation usually is a factor that is particularly focused on by theuser.

Paging display or segment loading in accordance with informationattributes usually leads to different amount of information loadedwithin every page or segment. With these methods, a scroll bar of a webpage can only provide the amount of information within a current page,and cannot inform the user of the amount of information within otherpages.

SUMMARY

Proposed is a method and apparatus for adding segment marks in a webpage, which are capable of, when a user is reading a current page,informing the user of amount of information within other pages.

A method for adding segment marks in a web page in accordance with anembodiment of the invention includes: acquiring an information attributeof an information piece displayed by a web browser, and settinginformation pieces having a same information attribute into a sameinformation segment; acquiring ratios of the number of informationpieces within every information segment to the total number ofinformation pieces displayed by the web browser; setting segment marksat particular locations of a scroll bar of the web browser in accordancewith the ratios; and displaying the segment marks.

An apparatus for adding segment marks in a web page in accordance withan embodiment of the invention includes: an information attributeacquiring module for acquiring an information attribute of aninformation piece displayed by a web browser, and setting informationpieces having a same information attribute into a same informationsegment; a acquiring module for acquiring ratios of the number ofinformation pieces within every information segment to the total numberof information pieces displayed by the web browser; a marking module forsetting segment marks at particular locations of a scroll bar of the webbrowser in accordance with the ratios; and a displaying module fordisplaying the segment marks.

The method and apparatus for adding segment marks in a web page inaccordance with an embodiment of the invention can add marks in the webpage for convenience of reviewing.

DESCRIPTION OF THE DRAWINGS

FIG. 1 is a flow diagram of a method for adding segment marks in a webpage in accordance with an embodiment of the invention;

FIG. 2 is a diagram of a display effect in accordance with an embodimentof the invention;

FIG. 3 is another diagram of a display effect in accordance with anembodiment of the invention;

FIG. 4 is a structural diagram of an apparatus for adding segment marksin a web page in accordance with an embodiment of the invention; and

FIG. 5 is a structure diagram of example hardware architecture of aterminal in which the method and apparatus for adding segment marks in aweb page in accordance with an embodiment of the invention can beimplemented.

DETAILED DESCRIPTION

A method for adding segment marks in a web page is proposed. FIG. 1 isflow chart of the method for adding segment marks in a web page inaccordance with an embodiment of the invention. As shown in FIG. 1, themethod includes:

Step 101: acquiring an information attribute of an information piecedisplayed by a web browser, and grouping information pieces having asame information attribute into a same information segment;

Step 102: acquiring ratios of the number of information pieces withinevery information segment to the total number of information piecesdisplayed by the web browser;

Step 103: setting segment marks at particular locations of a scroll barof the web browser in accordance with the ratios; and

Step 104: displaying the segment marks. In the above step 101, theinformation attribute can be specifically date attribute; for example, ainformation piece is published on May 2, and the information attributeof the information piece is “May 2”; the information segment can bespecifically an information segment consisting of all information pieceshaving the same date attribute; for example, multiple information piecesare published on May 2, and all the information pieces published on May2 belong to the information segment having the date attribute of “May2”. Alternatively the information attribute can be specifically aninformation publisher identifier; for example, a information piece ispublished by a user “A”, and the information attribute of theinformation piece is “A”; the information segment can be specifically aninformation segment consisting of all information pieces having the sameinformation publisher identifier; for example, the user “A” publishesmultiple information pieces, and all information pieces published by theuser “A” belong to the information segment having the informationattribute “A”.

In the above step 102, the way of acquiring the ratios of the number ofinformation pieces within every information segment to the total numberof information pieces displayed by the web browser is: when detectingthat information attributes of two adjacent information pieces displayedby the web browser are different, inserting a node between the twoadjacent information pieces, wherein the node carries the informationattribute of the latter of the two adjacent information pieces; based onnodes inserted into a queue of information pieces displayed by the webbrowser, acquiring the total number of information pieces displayed bythe web browser and the number of information pieces within everyinformation segment, and obtaining the ratios of the number ofinformation pieces within every information segment to the total numberof information pieces displayed by the web browser by dividing the totalnumber of information pieces displayed by the web browser by the numberof information pieces within every information segment.

In the above step 103, the way of setting the segment marks at theparticular locations of the scroll bar of the web browser in accordancewith the ratios is: setting node signs at dividing point locations, inaccordance with the radios, within a height range of the scroll bar ofthe web browser.

In the above method, after the node is inserted between the two adjacentinformation pieces, the method can further include: setting theinformation piece before the node as ending information piece of theinformation segment in which the information piece before the nodeexists, and setting the information piece after the node as startinginformation piece of the information segment in which the informationpiece after the node exists.

In the above method, the information attribute can be specifically atime attribute (for example, a date attribute) or an informationpublisher identifier.

Below, the method for adding segment marks in a web page in accordancewith an embodiment of the invention is described in detail by specificembodiments in conjunction with accompany drawings.

EMBODIMENT I

A method for adding segment marks in a web page in accordance with theembodiment includes the following steps:

Step 1: a website server pulls latest information pieces withininformation segments of “m” information attributes in accordance withthe information attributes, and transmits the information pieces to aclient, wherein each information piece carries its own informationattribute.

Step 2: when detecting that information attributes of two adjacentinformation pieces in a queue of received information pieces aredifferent, the client inserts a node between the two adjacentinformation pieces and adds the information attribute of the latter ofthe two adjacent information pieces on the node, wherein the informationpiece before the inserted node is ending information piece of aninformation segment in which the information piece before the insertednode exists, and the information piece after the inserted node isstarting information piece of an information segment in which theinformation piece after the inserted node exists.

Step 3: based on nodes inserted to the queue of received informationpieces, the client acquires the total number “N” of the latestinformation pieces within the information segments of the “m”information attributes and the numbers “n1”, “n2”, . . . , “nm” ofinformation pieces within information segments of every informationattribute, and calculates the information proportions “p” of informationsegments of every information attribute (i.e., the ratios between thenumber of information pieces of every information attribute and thetotal number of the latest information pieces within the informationsegments of the “m” information attributes, p1=n1/N, p2=n2/N, . . . ,pm=nm/N);

Step 4: the client sets node signs at particular locations neighboringor on a scroll bar in a web browser in accordance with the informationproportions “p” of information segments of every information attribute,wherein the particular locations are dividing points for dividing inaccordance with the information proportions “p” of the informationsegments of every information attribute within a height range of thescroll bar.

EMBODIMENT II

A method for adding segment marks in a web page in accordance with anembodiment of the invention includes the following steps:

Step 1: a website server pulls information pieces of latest “m” days andtransmits the information pieces to a client, wherein each informationpiece carries its own time mark containing year, month and dateinformation;

Step 2: when detecting that the date information in time marks of twoadjacent information pieces in a queue of received information piecesare different, the client inserts a node between the two adjacentinformation pieces and adds a date attribute of the latter of the twoadjacent information pieces on the inserted node, wherein theinformation piece before the inserted node is ending information pieceof an information segment of the date to which the information piecebefore the inserted node belongs, and the information piece after theinserted node is starting information piece of an information segment ofthe date to which the information piece after the inserted node belongs.

Step 3: based on the nodes inserted in the queue of received informationpieces, the client acquires the total number “N” of information piecesof the latest m days and the numbers “n1”, “n2”, . . . “nm” ofinformation pieces of every day, and calculates information proportions“p” of every day (that, the ratios between the number of informationpieces of every day and the total number of information pieces of thelatest m days, p1=n1/N, p2=n2/N, . . . ,pm=nm/N).

Step 4: the client sets node signs at particular locations neighboringor on a scroll bar in a web browser in accordance with the informationproportions “p” of every day, wherein the particular locations aredividing points for dividing in accordance with the informationproportions “p” of every day within a height range of the scroll bar.

EMBODIMENT III

A method for adding segment marks in a web page in accordance with theembodiment includes the following steps:

Step 1: a website server pulls information pieces of latest several days(for example, information pieces of latest three days, i.e. May 3, 2012,May 2, 2012, and May 1, 2012), and transmits the information pieces to aclient, wherein each information piece carries its own time markcontaining year-month-date-hour-minute-second information.

Step 2: when detecting that date information in the time marks of twoadjacent information pieces in a queue of received information piecesare different, the client inserts a date node between the two adjacentinformation pieces, adds the date attribute of the information pieceafter the inserted date node on the inserted date node, marks earlierinformation piece of the two adjacent information pieces as endinginformation piece of an information segment of the date to which theearlier information piece belongs, and marks later information piece ofthe two information pieces as starting information piece of aninformation segment of the date to which the later information piecebelongs.

For example, there are 20 information pieces on May 3, 2012, 30information pieces on May 2, 2012, and 40 information pieces on May 1,2012. When detecting that the date information of a earliest informationpiece on May 3, 2012 is “3” and the date information of a latestinformation piece on May 2, 2012 is “2”, which is different from thedate information of the former information piece (i.e., the earliestinformation piece on May 3, 2013), the client inserts a date nodebetween the earliest information piece on May 3, 2012 and the latestinformation piece on May 2, 2012 and adds the date attribute of “May 2,2012” on the inserted date node; when detecting that the dateinformation of a last information piece on May 2, 2012 is “2” and thedate information of a first information piece on May 1, 2012 is “1”,which is different from the date information of the former informationpiece (i.e., the last information piece on May 2, 2013), the clientinserts a date node between the last information piece on May 2, 2012and the first information piece on May 1, 2012 and adds the dateattribute of “May 1, 2012” on the inserted date node.

Step 3: based on the date nodes inserted in a queue of receivedinformation pieces, the client acquires the total number “N” ofinformation pieces of the several days and the numbers “n” ofinformation pieces of every day, and calculates information proportions“p” of every day (that is, the ratios “p=n/N” between the number ofinformation pieces of every day and the total number of informationpieces of the several days).

For example, in the embodiment, the total number of information piecesof the latest 3 days is N=20+30+40=90; the number “n1” of informationpieces on May 3 between the date node carrying the date attribute of“May 3” and the date node carrying the date attribute of “May 2” is 20;the number “n2” of information pieces on May 2 between the date nodecarrying the date attribute of “May 2” and the date node carrying thedate attribute of “May 1” is 30; the number “n3” of information pieceson May 1 after the date node carrying the date attribute of “May 1” is40; the ratio between the number of information pieces on May 3 and thetotal number of information pieces on the three days is p1=20/90=2/9,the ratio between the number of information pieces on May 2 and thetotal number of information pieces on the three days is p2=30/90=3/9,and the ratio between the number of information pieces on May 1 and thetotal number of information pieces on the three days is p3=40/90=4/9.

Step 4: the client sets node signs at particular locations neighboringor on a scroll bar in a web browser in accordance with the informationproportions “p” of every day. The particular locations are dividingpoints for dividing in accordance with the information proportions ofevery day within a height range of the scroll bar. For example, in theembodiment, as shown in FIG. 2, “May 3”, “May 2”, and “May 1” are markedin turn. When the scroll bar scrolls within a segment of “May 3”,information pieces on May 3 are browsed, the amount of information thathas been browsed by the user and the amount of rest information that hasnot been browsed by the user on May 3 can be displayed, and the ratiosbetween the information amount on May 3 and the information amounts onMay 2 and May 1 can be displayed. When the scroll bar scrolls to themark point of “May 2”, as shown in FIG. 3, it is indicated that theinformation pieces on May 3 has been completely browsed, and it isstarted to browse the information pieces on May 2.

EMBODIMENT IV

In the embodiment, the information attribute is specifically aninformation publisher identifier. A method for adding segment marks in aweb page in accordance with the embodiment includes:

Step 1: a website server pulls latest information pieces published by“m” users and transmits the information pieces to a client, wherein eachinformation piece carries an information publisher identifier thereof.

Step 2: when detecting that the information publisher identifiers of twoadjacent information pieces in a queue of received information piecesare different, the client inserts a node between the two adjacentinformation pieces and adds the information publisher identifier of thelatter of the two adjacent information pieces on the inserted node,wherein the information piece before the inserted node is endinginformation piece of an information segment of the former user, and theinformation piece after the inserted node is starting information pieceof an information segment of the current user.

Step 3: based on the nodes inserted in a queue of received informationpieces, the client acquires the total number “N” of the latestinformation pieces published by the “m” users and the numbers “n1”,“n2”, . . . , “nm” of information pieces published by every user, andcalculates the information proportions “p” of every user, i.e. theratios between the number of information pieces published by every userand the total number of the latest information pieces published by the“m” users p1=n1/N, p2=n2/N, . . . pm=nm/N.

Step 4: the client sets node signs at particular locations neighboring ascroll bar in a web browser or on the scroll bar in accordance with theproportions “p” of information published by every user, wherein theparticular locations are dividing points for dividing in accordance withthe proportions “p” of information published by every user within aheight range of the scroll bar.

It is noted that the above described embodiment I to embodiment IVimpliedly disclose the following processing of the client afterreceiving the queue of information pieces transmitted by the websiteserver: acquiring information attributes of information pieces in thereceived queue of information pieces (that is, information piecesdisplayed on a web browser), and grouping information pieces having asame information attribute in a same information segment. Specifically,the processing of the client inserting a node between two adjacentinformation pieces in the received queue of information pieces whendetecting that the information attributes of the two adjacentinformation pieces are different can be considered as a specificimplementation of the above processing of the client. Furthermore, inthe above described embodiment Ito embodiment IV, the node signs set atthe particular locations neighboring the scroll bar in the web browseror on the scroll bar can be considered as segment marks, and arecorresponding to the nodes inserted in the received queue of informationpieces by the client.

The invention further proposes an apparatus for adding segment marks ina web page.

FIG. 4 is a structural diagram of an apparatus for adding segment marksin a web page in accordance with an embodiment of the invention. Asshown in FIG. 4, the apparatus includes: an information attributeacquiring module 401 for acquiring an information attribute of aninformation piece displayed by a web browser, and grouping informationpieces having a same information attribute into a same informationsegment; a acquiring module 402 for acquiring ratios between the numberof information pieces within every information segment and the totalnumber of information pieces displayed by the web browser; a markingmodule 403 for setting segment marks at particular locations of a scrollbar of the web browser in accordance with the ratios calculated by theacquiring module 402; and a displaying module 404 for displaying thesegment marks.

In the above apparatus, the acquiring module 402 acquires the ratiosbetween the number of information pieces within every informationsegment and the total number of information pieces displayed by the webbrowser by the following processing: when detecting that informationattributes of two adjacent information pieces displayed by the webbrowser are different, inserting a node between the two informationpieces, wherein the node carries an information attribute of the latterof the two adjacent information pieces; based on nodes inserted into aqueue of received information pieces displayed by the web browser,calculating the total number of information pieces displayed by the webbrowser and the number of information pieces within every informationsegment, and obtaining the ratios between the number of informationpieces within every information segment and the total number ofinformation pieces displayed by the web browser by dividing the totalnumber of information pieces displayed by the web browser by the numberof information pieces within every information segment.

The marking module 403 sets the segment marks at the particularlocations of the scroll bar of the web browser in accordance with theratios calculated by the acquiring module 402 by the followingprocessing: setting node signs at dividing points for dividing inaccordance with the radios within a height range of the scroll bar ofthe web browser.

The marking module 403 is further configured for setting the informationpiece before the node as ending information piece of an informationsegment in which the information piece before the node exists, andsetting the information piece after the node as starting informationpiece of an information segment in which the information piece after thenode exists.

In the above apparatus, the information attribute can be a dateattribute or an information publisher identifier.

In the above embodiments, the present invention is illustrated with dateor information publisher identifier as the example of the informationattribute. In the example of date, the same information attribute, forexample, may refer to the date of the same day; in the example ofinformation publisher identifier, the same information attribute, forexample, may refer to the publisher of the same person. However,information attribute is not limited to those examples, and may be setas desired according to particular contents and displays. In addition,they can be used in single or in combination. For example, theinformation published by a person at a day may be regarded as having thesame information attribute.

The method and apparatus for adding segment marks in a web pagedescribed in conjunction with FIGS. 1-4 are applicable to various typesof terminal, such as a desktop computer, a portable computer, a tabletcomputer, a feature phone, a smart phone, a Personal Digital Assistant(PDA) and so on. Although some specific components of the terminals aredifferent, primary constituting portions of them are substantially thesame.

FIG. 5 is a structure diagram of example hardware architecture of asmart terminal. As shown in FIG. 5, a smart terminal 500 mainly includesan input device 501, an input interface 502, a central processor 503, amemory 504, an output interface 505, and an output device 506. The inputinterface 502, the central processor 503, the memory 504, and the outputinterface 505 are interconnected via a bus 510, and the input device 502and the output device 506 are connected to the bus 510 via the inputinterface 502 and the output interface 505 respectively and thenconnected to other components in the smart terminal 500. Specifically,the input device 501 receives input information from external, andtransmits the input information to the central processor 503 via theinput interface 502; the central processor 503 processes the inputinformation to generate output information, temporarily or persistentlystores the output information in the memory 504, and then transmits theoutput information to the output device 506 via the output interface505; the output device 506 outputs the output information to external ofthe smart terminal 500 for use by a user.

Actually, a terminal, in which the method and apparatus for addingsegment marks in a web page proposed in the invention is implemented,can inform a user the information amounts of other pages when the useris reading a current page by acquiring the number of information piecesof every segment and their proportions and correspondingly setting nodesigns on the scroll bar. In addition, it can inform the user of thereading progress of the user by adding and displaying node signs.

The sequence numbers of the above embodiments of the disclosure are onlyfor the purpose of description, and do not represent one embodiment issuperior to another.

The above are merely prefer embodiments of the invention, and cannot beused to limit the protection scopes of the invention. Any amendment,equivalent alternative, improvement and so on within the sprite andprinciple of the invention shall be contained in the protection scopesof the invention.

What is claimed is:
 1. A method for adding segment marks in a web page,including: acquiring an information attribute of an information piecedisplayed by a web browser, and grouping information pieces having asame information attribute into a same information segment; acquiringratios of the number of information pieces within every informationsegment to the total number of information pieces displayed by the webbrowser; setting segment marks at particular locations of a scroll barof the web browser in accordance with the ratios; and displaying thesegment marks.
 2. The method of claim 1, wherein acquiring the ratios ofthe number of information pieces within every information segment to thetotal number of information pieces displayed by the web browserincludes: inserting a node between two adjacent information piecesdisplayed by the web browser if they have different informationattributes, wherein the node carries the information attribute of thelatter of the two adjacent information pieces; calculating the totalnumber of information pieces displayed by the web browser and the numberof information pieces within every information segment based on the nodeinserted into a queue of information pieces displayed by the webbrowser; and acquiring the ratios of the number of information pieceswithin every information segment to the total number of informationpieces displayed by the web browser by dividing the total number ofinformation pieces displayed by the web browser by the number ofinformation pieces within every information segment.
 3. The method ofclaim 2, wherein setting the segment marks at the particular locationsof the scroll bar of the web browser in accordance with the ratiosincludes: setting node signs at dividing point locations which dividethe scroll bar of the web browser in height based on the radios.
 4. Themethod of claim 2, wherein the method further includes, after insertingthe node between the two adjacent information pieces, the followingprocessing: setting the information piece before the node as endinginformation piece of the information segment in which the informationpiece before the node exists, and setting the information piece afterthe node as starting information piece of the information segment inwhich the information piece after the node exists.
 5. The method ofclaim 1, wherein the information attribute is date or informationpublisher identifier.
 6. An apparatus for adding segment marks in a webpage, including: an information attribute acquiring module for acquiringan information attribute of an information piece displayed by a webbrowser, and for grouping information pieces having a same informationattribute into a same information segment; a acquiring module foracquiring ratios of the number of information pieces within everyinformation segment to the total number of information pieces displayedby the web browser; a marking module for setting segment marks atparticular locations of a scroll bar of the web browser in accordancewith the ratios; and a displaying module for displaying the segmentmarks.
 7. The apparatus of claim 6, wherein the acquiring moduleacquires the ratios of the number of information pieces within everyinformation segment to the total number of information pieces displayedby the web browser by: inserting a node between two adjacent informationpieces displayed by the web browser if they have different informationattributes, wherein the node carries the information attribute of thelatter of the two adjacent information pieces; acquiring the totalnumber of information pieces displayed by the web browser and the numberof information pieces within every information segment based on nodesinserted into a queue of information pieces displayed by the webbrowser; and obtaining the ratios of the number of information pieceswithin every information segment to the total number of informationpieces displayed by the web browser by dividing the total number ofinformation pieces displayed by the web browser by the number ofinformation pieces within every information segment.
 8. The apparatus ofclaim 7, wherein the marking module sets the segment marks at theparticular locations of the scroll bar of the web browser in accordancewith the ratios by: setting node signs at dividing point locations whichdivides the scroll bar of the web browser in height based on the radios.9. The apparatus of claim 7, wherein the marking module is furtherconfigured for: setting the information piece before the node as endinginformation piece of the information segment in which the informationpiece before the node exists, and setting the information piece afterthe node as starting information piece of the information segment inwhich the information piece after the node exists.
 10. The apparatus ofclaim 6, wherein the information attribute is date or informationpublisher identifier.
 11. A terminal including the apparatus for addingsegment marks in a web browser, the apparatus including: an informationattribute acquiring module for acquiring an information attribute of aninformation piece displayed by a web browser, and for groupinginformation pieces having a same information attribute into a sameinformation segment; a acquiring module for acquiring ratios of thenumber of information pieces within every information segment to thetotal number of information pieces displayed by the web browser; amarking module for setting segment marks at particular locations of ascroll bar of the web browser in accordance with the ratios; and adisplaying module for displaying the segment marks.